package com.upbos.upm.app;

import com.upbos.upm.entity.App;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <b>Application name：</b> AppController.java <br>
 * <b>Application describing: 应用管理API</b> <br>
 * <b>Copyright：</b> Copyright &copy; 2015-2021 yideb.com 版权所有。<br>
 * <b>Company：</b> yideb.com <br>
 * <b>Date：</b> 2019年07月11日 17:09 <br>
 * <b>author：</b> <a href="mailto:wangjz@miyzh.com"> Jason </a>
 * <b>version：</b>V5.0.0
 * @author wangjz
 */
@RestController
@RequestMapping("upm/app")
public class AppController {

	@Resource
	private AppService appService;

	/**
	 * 查询应用列表
	 * @param name 应用名称
	 * @return 应用列表
	 */
	@RequestMapping("listApp")
	public List<App> listApp(String name) {
		return appService.listApp(name);
	}

	/**
	 * 保存应用信息
	 * @param app 应用信息
	 */
	@RequestMapping(value = "saveApp", method = RequestMethod.POST)
	public void saveApp(App app) {
		appService.saveApp(app);
	}

	/**
	 * 删除应用信息
	 * @param app 应用信息
	 */
	@RequestMapping(value = "deleteApp", method = RequestMethod.POST)
	public void deleteApp(App app) {
		appService.deleteApp(app);
	}
}
